﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<script language="c#" runat="server">
protected bool IsImage(DataRow record)
{
	string name = record[Alias.Skin.Image.FileName].ToString().ToLower();
	if (name.EndsWith("gif") || name.EndsWith("jpg") || name.EndsWith("jpeg") || name.EndsWith("png") || name.EndsWith("bmp"))
		return true;
	else
		return false;
}
</script>
<section data-page="skin_image_list" data-title="图片列表" data-lang="<%=ContentLang%>" data-skin-path="<%=Request.QueryString["SkinPath"]%>">
	<dl class="path1">
		<dt><span>您的位置：</span><a href="../list.aspx" target="ali-navtab">皮肤列表</a> → <%=Request.QueryString["SkinPath"]%></dt>
	</dl>
	<form action="?SkinPath=<%=Request.QueryString["SkinPath"]%>" class="search1">
		文件夹：
		<select name="Folder" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
			<option value="/">/</option>
			<ali:List Object="Skin.Image" Operation="ListFolder(Request.QueryString['SkinPath'])">
				<ali:Record>
					<option value="<%=FolderName%>"><%=FolderName%></option>
				</ali:Record>
			</ali:List>
		</select>
		<button type="button" class="ali-button" data-operation="DeleteFolder">删除</button>
		<button type="submit" class="ali-button" style="display:none">搜索</button>
	</form>
	<div class="content">
		<table class="system-image-list">
			<ali:List Object="Skin.Image" Operation="ListFile(Request.QueryString['SkinPath'], Request.QueryString['Folder'])" Validate="True">
				<ali:Row MaxCol="4">
					<tr>
						<ali:Col MaxRecord="1">
							<ali:Record>
								<td data-id="<%=FileName%>">
									<%If IsImage(Record)%>
										<a href="<%=Manager.GetImagePath(Request.QueryString["SkinPath"])%><%=Request.QueryString["Folder"]%>/<%=FileName%>" target="_blank"><img src="<%=Manager.GetImagePath(Request.QueryString["SkinPath"])%><%=Request.QueryString["Folder"]%>/<%=FileName%>" alt=""></a>
										<div><span><%=FileName%></span><a href="" class="ali-button" data-operation="Delete">删除</a></div>
									<%Else%>
										<a href="<%=Manager.GetImagePath(Request.QueryString["SkinPath"])%><%=Request.QueryString["Folder"]%>/<%=FileName%>" target="_blank">点击看原文件</a>
										<div><span><%=FileName%></span><a href="" class="ali-button" data-operation="Delete">删除</a></div>
									<%EndIf%>
								</td>
							</ali:Record>
						</ali:Col>
					</tr>
				</ali:Row>
			</ali:List>
		</table>
	</div>
</section>